import java.util.PriorityQueue;
import java.util.Scanner;

public class test {
    //除2!
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
//        int[] a = new int[n];
//        for (int i = 0; i < n; i++) {
//            a[i] = in.nextInt();
//        }
//
//        int max = 0,num = 0;
//        for (int i = 0; i < k; i++) {
//            for (int j = 0; j < n; j++) {
//                if(a[j]%2 == 0 && a[j]>max){
//                    max = j;
//                }
//            }
//            a[max] = a[max]/2;
//            max = 0;
//        }
//        for (int i = 0; i < n; i++) {
//            num += a[i];
//        }
//        System.out.println(num);
        PriorityQueue<Integer> heap = new PriorityQueue<>((a, b)-> {
            return b - a;
        });
        
        long sum = 0,x;
        for (int i = 0; i < n; i++) {
            x = in.nextLong();
            sum += x;
            if(x % 2 == 0){
                heap.add((int)x);
            }
        }

        while(!heap.isEmpty() && k-- != 0){
            long t = heap.poll() / 2;
            sum -= t;
            if(t % 2 == 0){
                heap.add((int)t);
            }
        }
        System.out.println(sum);
    }

    //dd爱框框-----滑动窗口问题----待解决
    public static void main4(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        int l = 0,r = 0;
        int min = 0,max = 0;
        while(max < x){
            for (l = 0; l < n; l++) {
                for (int i = 0; i < n; i++) {
                    min = r - l;
                    r = i;
                    max += a[i];
                }
            }
        }
        System.out.print(l + " ");
        System.out.print(r);
    }

    //简写单词
    public static void main3(String[] args) {
//        Scanner in = new Scanner(System.in);
//        String str = in.nextLine();
//        String str2 = new String();
//
//        for (int j = 1; j < str.length(); j++) {
//            if(str.charAt(j) == ' '){
//                j++;
//            }
//        }
//        System.out.println(str2);

        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        String[] strs = str.split(" ");

        StringBuilder stb = new StringBuilder();
        for (int i = 0; i < strs.length; i++) {
            stb.append(strs[i].charAt(0));
        }
        System.out.println(stb.toString().toUpperCase());
        in.close();
    }

    //NC296 最小花费爬楼梯
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] cost = new int[n];
        for (int i = 0; i < n; i++) {
            cost[i] = in.nextInt();
        }

        test t1 = new test();
        int minCost = t1.func(cost);
        in.close();
    }

    public int func(int[] cost){
        //dp[i]表示爬到第i阶楼梯需要的最小花费。
        //数组dp的长度被设置为cost.length + 1，因为我们需要计算到达顶部
        //（即第n阶之后）的最小花费，所以数组长度需要比cost数组的长度多1。
        int[] dp = new int[cost.length + 1];
        //循环从i = 2开始，是因为到达第1阶和第2阶楼梯的花费可以直接从cost数组中获取，
        //而从第3阶开始，我们需要根据之前的花费来计算。
        for (int i = 2; i <= cost.length; i++) {
            dp[i] = Math.min(dp[i-1] + cost[i-1],dp[i-2] + cost[i-2]);
        }
        return dp[cost.length];
    }

    //BC64 牛牛的快递
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        float a = in.nextFloat();
        char b = in.next().charAt(0);//'y' or 'n'
        int price = 0;

        if(a < 1.0){
            price = 20;
        }else if ((a-1.0)%1.0 == 0){
            price = 20 + (int)(a-1.0);
        }else{
            price = (int)(20 + a);
        }

        if(b == 'y'){
            price+=5;
        }

        System.out.println(price);
    }
}
